﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Lamex.Library;
using System.Drawing.Drawing2D;
using Lamex.Common;
using Lamex.SystemManager.Model;
using Lamex.SystemManager.BLL;
using Lamex.Base;

namespace Lamex.mMES.UI
{
    public partial class frmMES_System_Menu_Structure : frmBaseChild
    {
        int v1, h1;

        public frmMES_System_Menu_Structure()
        {
            InitializeComponent();
            this.TextChanged += new EventHandler(frmMES_System_Menu_Structure_TextChanged);
        }

        private void frmMES_System_Menu_Structure_TextChanged(object sender, EventArgs e)
        {
            Init();
        }

        private void frmMES_System_Menu_Structure_Load(object sender, EventArgs e)
        {
            //设置treeview背景色为透明，此方法无效
            //this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            //tv_MES.BackColor = Color.Transparent;
            Init();
        }

        private void frmMES_System_Menu_Structure_Resize(object sender, EventArgs e)
        {
            v1 = (this.Height - 30) / 3;
            h1 = (this.Width - 30) / 9;

            splitContainerControl1.SplitterPosition = v1;
            splitContainerControl2.SplitterPosition = v1;

            groupControl1.Width = h1;
            groupControl2.Width = h1;
            groupControl3.Width = h1;
            groupControl4.Width = h1;
            groupControl5.Width = h1;
            groupControl6.Width = h1;
            groupControl7.Width = h1;
            groupControl8.Width = h1;
            groupControl9.Width = h1;

            groupControl10.Width = h1;
            groupControl11.Width = h1;
            groupControl12.Width = h1;
            groupControl13.Width = h1;
            groupControl14.Width = h1;
            groupControl15.Width = h1;
            groupControl16.Width = h1;
            groupControl17.Width = h1;

            groupControl18.Width = h1;
            groupControl19.Width = h1;
            groupControl20.Width = h1;
            groupControl21.Width = h1;
            groupControl22.Width = h1;
            groupControl23.Width = h1;
            groupControl24.Width = h1;

            groupControl25.Width = h1;
            groupControl26.Width = h1 * 2;
        }

        private void treeViewClear()
        {
            foreach (Control item in this.Controls)
            {
                if (item is TreeView)
                {
                    item.Text = "";
                }
            }
        }

        private void Init()
        {
            string systemType = "001";//系统标识
            List<MenuNodeInfo> menuList = BaseFactory<Sys_Menu>.Instance.GetTree(systemType).ToList();

            #region 清空菜单树.Clear

            tv_MES.Nodes.Clear();
            tv_NC.Nodes.Clear();
            tv_PE.Nodes.Clear();
            tv_SJ.Nodes.Clear();
            tv_IE.Nodes.Clear();
            tv_SA.Nodes.Clear();
            tv_PPC.Nodes.Clear();
            tv_QC.Nodes.Clear();
            tv_FAMA.Nodes.Clear();

            tv_Capacity.Nodes.Clear();
            tv_Schedule.Nodes.Clear();
            tv_Efficiency.Nodes.Clear();
            tv_Cost.Nodes.Clear();
            tv_Labor.Nodes.Clear();
            tv_Material.Nodes.Clear();
            tv_Report.Nodes.Clear();
            tv_Kanban.Nodes.Clear();

            tv_Tools.Nodes.Clear();
            tv_Resource.Nodes.Clear();
            tv_System.Nodes.Clear();

            //tv_Recently.Nodes.Clear();
            //tv_Skin.Nodes.Clear();
            //tv_Help.Nodes.Clear();
            //tv_Language.Nodes.Clear();

            #endregion

            #region 开始刷新菜单树.BeginUpdate

            tv_MES.BeginUpdate();
            tv_NC.BeginUpdate();
            tv_PE.BeginUpdate();
            tv_SJ.BeginUpdate();
            tv_IE.BeginUpdate();
            tv_SA.BeginUpdate();
            tv_PPC.BeginUpdate();
            tv_QC.BeginUpdate();
            tv_FAMA.BeginUpdate();

            tv_Capacity.BeginUpdate();
            tv_Schedule.BeginUpdate();
            tv_Efficiency.BeginUpdate();
            tv_Cost.BeginUpdate();
            tv_Labor.BeginUpdate();
            tv_Material.BeginUpdate();
            tv_Report.BeginUpdate();
            tv_Kanban.BeginUpdate();

            tv_Tools.BeginUpdate();
            tv_Resource.BeginUpdate();
            tv_System.BeginUpdate();

            //tv_Recently.BeginUpdate();
            //tv_Skin.BeginUpdate();
            //tv_Help.BeginUpdate();
            //tv_Language.BeginUpdate();

            #endregion

            #region 加载中英文菜单树

            Cursor.Current = Cursors.WaitCursor;
            if (Loginer.CurrentUser.ChangeLanguage != 0 || radioGroup1.SelectedIndex ==1)
            {
                Menutools.Text = "Expland";
                foreach (MenuNodeInfo info in menuList)
                {
                    if (info.EngName == "MES")
                    {
                        AddChildNodeMemu(info.Children, tv_MES); groupControl1.Text = "MES";
                    }
                    else if (info.EngName == "NC")
                    {
                        AddChildNodeMemu(info.Children, tv_NC); groupControl2.Text = "NC";
                    }
                    else if (info.EngName == "PE")
                    {
                        AddChildNodeMemu(info.Children, tv_PE); groupControl3.Text = "PE";
                    }
                    else if (info.EngName == "SJ")
                    {
                        AddChildNodeMemu(info.Children, tv_SJ); groupControl4.Text = "SJ";
                    }
                    else if (info.EngName == "IE+")
                    {
                        AddChildNodeMemu(info.Children, tv_IE); groupControl5.Text = "IE+";
                    }
                    else if (info.EngName == "SA")
                    {
                        AddChildNodeMemu(info.Children, tv_SA); groupControl6.Text = "SA";
                    }
                    else if (info.EngName == "PPC")
                    {
                        AddChildNodeMemu(info.Children, tv_PPC); groupControl7.Text = "PPC";
                    }
                    else if (info.EngName == "QUALITY")
                    {
                        AddChildNodeMemu(info.Children, tv_QC); groupControl8.Text = "QC";
                    }
                    else if (info.EngName == "EQP")
                    {
                        AddChildNodeMemu(info.Children, tv_FAMA); groupControl9.Text = "FAMA";
                    }
                    else if (info.EngName == "CAPACITY")
                    {
                        AddChildNodeMemu(info.Children, tv_Capacity); groupControl10.Text = "Capacity";
                    }
                    else if (info.EngName == "SCHEDULE")
                    {
                        AddChildNodeMemu(info.Children, tv_Schedule); groupControl11.Text = "Schedule";
                    }
                    else if (info.EngName == "EFFICIENCY")
                    {
                        AddChildNodeMemu(info.Children, tv_Efficiency); groupControl12.Text = "Efficiency";
                    }
                    else if (info.EngName == "COST")
                    {
                        AddChildNodeMemu(info.Children, tv_Cost); groupControl13.Text = "Cost";
                    }
                    else if (info.EngName == "LABOR")
                    {
                        AddChildNodeMemu(info.Children, tv_Labor); groupControl14.Text = "Labor";
                    }
                    else if (info.EngName == "Material MGMT")
                    {
                        AddChildNodeMemu(info.Children, tv_Material); groupControl15.Text = "Material";
                    }

                    else if (info.EngName == "REPORT")
                    {
                        AddChildNodeMemu(info.Children, tv_Report); groupControl16.Text = "Report";
                    }
                    else if (info.EngName == "KANBAN")
                    {
                        AddChildNodeMemu(info.Children, tv_Kanban); groupControl17.Text = "Kanban";
                    }
                    else if (info.EngName == "TOOL")
                    {
                        AddChildNodeMemu(info.Children, tv_Tools); groupControl18.Text = "Tools";
                    }
                    else if (info.EngName == "RESOURCE")
                    {
                        AddChildNodeMemu(info.Children, tv_Resource); groupControl19.Text = "Resources";
                    }
                    else if (info.EngName == "SYS")
                    {
                        AddChildNodeMemu(info.Children, tv_System); groupControl20.Text = "System";
                    }
                }
            }
            else
            {
                Menutools.Text = "展开";
                foreach (MenuNodeInfo info in menuList)
                {
                    if (info.Name == "MES ")
                    {
                        AddChildNodeMemu(info.Children, tv_MES); groupControl1.Text = "MES";
                    }
                    else if (info.Name == "NC")
                    {
                        AddChildNodeMemu(info.Children, tv_NC); groupControl2.Text = "NC";
                    }
                    else if (info.Name == "PE ")
                    {
                        AddChildNodeMemu(info.Children, tv_PE); groupControl3.Text = "PE";
                    }
                    else if (info.Name == "SJ ")
                    {
                        AddChildNodeMemu(info.Children, tv_SJ); groupControl4.Text = "SJ";
                    }
                    else if (info.Name == "IE+ ")
                    {
                        AddChildNodeMemu(info.Children, tv_IE); groupControl5.Text = "IE+";
                    }
                    else if (info.Name == "SA")
                    {
                        AddChildNodeMemu(info.Children, tv_SA); groupControl6.Text = "SA";
                    }
                    else if (info.Name == "PPC")
                    {
                        AddChildNodeMemu(info.Children, tv_PPC); groupControl7.Text = "PPC";
                    }
                    else if (info.Name == "QC")
                    {
                        AddChildNodeMemu(info.Children, tv_QC); groupControl8.Text = "QC";
                    }
                    else if (info.Name == "设备")
                    {
                        AddChildNodeMemu(info.Children, tv_FAMA); groupControl9.Text = "设备";
                    }
                    else if (info.Name == "产能 ")
                    {
                        AddChildNodeMemu(info.Children, tv_Capacity); groupControl10.Text = "产能";
                    }
                    else if (info.Name == "进度")
                    {
                        AddChildNodeMemu(info.Children, tv_Schedule); groupControl11.Text = "进度";
                    }
                    else if (info.Name == "效率 ")
                    {
                        AddChildNodeMemu(info.Children, tv_Efficiency); groupControl12.Text = "效率";
                    }
                    else if (info.Name == "成本")
                    {
                        AddChildNodeMemu(info.Children, tv_Cost); groupControl13.Text = "成本";
                    }
                    else if (info.Name == "人工")
                    {
                        AddChildNodeMemu(info.Children, tv_Labor); groupControl14.Text = "人工";
                    }
                    else if (info.Name == "物料")
                    {
                        AddChildNodeMemu(info.Children, tv_Material); groupControl15.Text = "物料";
                    }
                    else if (info.Name == "报表")
                    {
                        AddChildNodeMemu(info.Children, tv_Report); groupControl16.Text = "报表";
                    }
                    else if (info.Name == "看板")
                    {
                        AddChildNodeMemu(info.Children, tv_Kanban); groupControl17.Text = "看板";
                    }
                    else if (info.Name == "工具 ")
                    {
                        AddChildNodeMemu(info.Children, tv_Tools); groupControl18.Text = "工具";
                    }
                    else if (info.Name == "资源 ")
                    {
                        AddChildNodeMemu(info.Children, tv_Resource); groupControl19.Text = "资源";
                    }
                    else if (info.Name == "系统")
                    {
                        AddChildNodeMemu(info.Children, tv_System); groupControl20.Text = "系统";
                    }
                }
            }

            #endregion

            #region 结束刷新菜单树.EndUpdate 

            Cursor.Current = Cursors.Default;

            tv_MES.EndUpdate();
            tv_NC.EndUpdate();
            tv_PE.EndUpdate();
            tv_SJ.EndUpdate();
            tv_IE.EndUpdate();
            tv_SA.EndUpdate();
            tv_PPC.EndUpdate();
            tv_QC.EndUpdate();
            tv_FAMA.EndUpdate();

            tv_Capacity.EndUpdate();
            tv_Schedule.EndUpdate();
            tv_Efficiency.EndUpdate();
            tv_Cost.EndUpdate();
            tv_Labor.EndUpdate();
            tv_Material.EndUpdate();
            tv_Report.EndUpdate();
            tv_Kanban.EndUpdate();

            tv_Tools.EndUpdate();
            tv_Resource.EndUpdate();
            tv_System.EndUpdate();

            //tv_Recently.EndUpdate();
            //tv_Skin.EndUpdate();
            //tv_Help.EndUpdate();
            //tv_Language.EndUpdate();

            //this.treeView1.ExpandAll();

            #endregion

        }

        private void AddChildNodeMemu(List<MenuNodeInfo> list, TreeView tv)
        {
            foreach (MenuNodeInfo info in list)
            {
                if (Loginer.CurrentUser.ChangeLanguage != 0 || radioGroup1.SelectedIndex == 1)
                {
                    TreeNode item = new TreeNode();
                    item.Name = info.ID;
                    item.Text = info.EngName;//一级菜单节点
                    item.Tag = info;//对菜单而言，记录其MenuNodeInfo到Tag中，作为判断依据
                    item.ImageIndex = 1;
                    item.SelectedImageIndex = 1;
                    tv.Nodes.Add(item);
                    AddChildNode(info.Children, item);
                }
                else
                {
                    TreeNode item = new TreeNode();
                    item.Name = info.ID;
                    item.Text = info.Name;//一级菜单节点
                    item.Tag = info;//对菜单而言，记录其MenuNodeInfo到Tag中，作为判断依据
                    item.ImageIndex = 1;
                    item.SelectedImageIndex = 1;
                    tv.Nodes.Add(item);
                    AddChildNode(info.Children, item);
                }

            }
        }

        private void AddChildNode(List<MenuNodeInfo> list, TreeNode fnode)
        {
            foreach (MenuNodeInfo info in list)
            {
                if (Loginer.CurrentUser.ChangeLanguage != 0 || radioGroup1.SelectedIndex == 1)
                {
                    TreeNode item = new TreeNode();
                    item.Name = info.ID;
                    item.Text = info.EngName;//二、三级菜单节点
                    item.Tag = info;//对菜单而言，记录其MenuNodeInfo到Tag中，作为判断依据
                    int index = (fnode.ImageIndex + 1 > 3) ? 3 : fnode.ImageIndex + 1;
                    item.ImageIndex = index;
                    item.SelectedImageIndex = index;
                    fnode.Nodes.Add(item);
                    AddChildNode(info.Children, item);
                }
                else
                {
                    TreeNode item = new TreeNode();
                    item.Name = info.ID;
                    item.Text = info.Name;//二、三级菜单节点
                    item.Tag = info;//对菜单而言，记录其MenuNodeInfo到Tag中，作为判断依据
                    int index = (fnode.ImageIndex + 1 > 3) ? 3 : fnode.ImageIndex + 1;
                    item.ImageIndex = index;
                    item.SelectedImageIndex = index;
                    fnode.Nodes.Add(item);
                    AddChildNode(info.Children, item);
                }
            }
        }

        private void stool_Expland_Click(object sender, EventArgs e)
        {
            tv_MES.ExpandAll();
            tv_NC.ExpandAll();
            tv_PE.ExpandAll();
            tv_SJ.ExpandAll();
            tv_IE.ExpandAll();
            tv_SA.ExpandAll();
            tv_PPC.ExpandAll();
            tv_QC.ExpandAll();
            tv_FAMA.ExpandAll();

            tv_Capacity.ExpandAll();
            tv_Schedule.ExpandAll();
            tv_Efficiency.ExpandAll();
            tv_Cost.ExpandAll();
            tv_Labor.ExpandAll();
            tv_Material.ExpandAll();
            tv_Report.ExpandAll();
            tv_Kanban.ExpandAll();

            tv_Tools.ExpandAll();
            tv_Resource.ExpandAll();
            tv_System.ExpandAll();

            tv_Recently.ExpandAll();
            tv_Skin.ExpandAll();
            tv_Help.ExpandAll();
            tv_Language.ExpandAll();
        }

        private void radioGroup1_SelectedIndexChanged(object sender, EventArgs e)
        {
            Init();
        }

        private void checkEdit1_CheckedChanged(object sender, EventArgs e)
        {
            this.Refresh();
        }

        #region 展开/收缩菜单面板

        private void gcOrganization_DoubleClick(object sender, EventArgs e)
        {
            if (splitContainerControl1.SplitterPosition == v1)
            {
                splitContainerControl1.SplitterPosition = (this.Height - 60 - 60);
                splitContainerControl2.SplitterPosition = 30;
            }
            else
            {
                splitContainerControl1.SplitterPosition = v1;
                splitContainerControl2.SplitterPosition = v1;
            }
        }

        private void gcFunction_DoubleClick(object sender, EventArgs e)
        {
            if (splitContainerControl2.SplitterPosition == v1)
            {
                splitContainerControl1.SplitterPosition = 30;
                splitContainerControl2.SplitterPosition = (this.Height - 60 - 60);
            }
            else
            {
                splitContainerControl1.SplitterPosition = v1;
                splitContainerControl2.SplitterPosition = v1;
            }
        }

        private void gcSystem_DoubleClick(object sender, EventArgs e)
        {
            if (splitContainerControl2.SplitterPosition == v1)
            {
                splitContainerControl1.SplitterPosition = 30;
                splitContainerControl2.SplitterPosition = 30;
            }
            else
            {
                splitContainerControl1.SplitterPosition = v1;
                splitContainerControl2.SplitterPosition = v1;
            }
        }

        #endregion

        #region 设置背景颜色

        private void Control_Paint(PaintEventArgs e, Color TColor, GroupControl gc)
        {
            Graphics g = e.Graphics;
            Color FColor = Color.Transparent;
            //Color TColor = Color.BlanchedAlmond;
            //Brush b = new LinearGradientBrush(groupControl25.ClientRectangle, FColor, TColor, LinearGradientMode.ForwardDiagonal);

            if (checkEdit1.Checked == true)
            {
                Brush b = new LinearGradientBrush(new Rectangle(10, 5, gc.Width, gc.Height), FColor, TColor, LinearGradientMode.ForwardDiagonal);
                g.FillRectangle(b, this.ClientRectangle);
            }
            else
            {
                Brush b = new LinearGradientBrush(new Rectangle(10, 5, gc.Width, gc.Height), FColor, Color.Transparent, LinearGradientMode.ForwardDiagonal);
                g.FillRectangle(b, this.ClientRectangle);
            }
        }

        private void groupControl1_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.Magenta, groupControl1);//洋红
            //tv_MES.BackColor = groupControl1.BackColor;
        }

        private void groupControl2_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.Aqua, groupControl2);//浅绿色
            //tv_NC.BackColor = groupControl2.BackColor;
        }

        private void groupControl3_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.Aquamarine, groupControl3);//碧绿色
            //tv_PE.BackColor = groupControl3.BackColor;
        }

        private void groupControl4_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.Azure, groupControl4);//天蓝色
            //tv_SJ.BackColor = groupControl4.BackColor;
        }

        private void groupControl5_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.Bisque, groupControl5);//杏仁白
            //tv_IE.BackColor = groupControl5.BackColor;
        }

        private void groupControl6_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.BlanchedAlmond, groupControl6);//橘黄色
            //tv_SA.BackColor = groupControl6.BackColor;
        }

        private void groupControl7_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.BlueViolet, groupControl7);//紫罗兰色
            //tv_PPC.BackColor = groupControl7.BackColor;
        }

        private void groupControl8_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.BurlyWood, groupControl8);//原木色
            //tv_QC.BackColor = groupControl8.BackColor;
        }

        private void groupControl9_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.CadetBlue, groupControl9);//藏青,军蓝色
            //tv_FAMA.BackColor = groupControl9.BackColor;
        }

        private void groupControl10_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.Chartreuse, groupControl10);//黄绿色
        }

        private void groupControl11_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.Coral, groupControl11);//珊瑚色
        }

        private void groupControl12_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.CornflowerBlue, groupControl12);//矢车菊蓝
        }

        private void groupControl13_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.Cornsilk, groupControl13);//玉米色
        }

        private void groupControl14_Paint(object sender, PaintEventArgs e)
        {
            //Control_Paint(e, Color.Crimson);//深红色
            //Control_Paint(e, Color.DimGray);//暗灰色
            //Control_Paint(e, Color.DodgerBlue);//闪蓝色,宝蓝
            Control_Paint(e, Color.ForestGreen, groupControl14);//丛林绿
        }

        private void groupControl15_Paint(object sender, PaintEventArgs e)
        {
            //Control_Paint(e, Color.Fuchsia);//紫红色
            Control_Paint(e, Color.Gainsboro, groupControl15);//亮灰
        }

        private void groupControl16_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.Honeydew, groupControl16);//浅粉红
        }

        private void groupControl17_Paint(object sender, PaintEventArgs e)
        {
            //Control_Paint(e, Color.Indigo);//靛蓝
            Control_Paint(e, Color.Ivory, groupControl17);//象牙白
        }

        private void groupControl18_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.Khaki, groupControl18);//卡其色
        }

        private void groupControl19_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.Lavender, groupControl19);//薰衣草,淡紫色
            //Control_Paint(e, Color.LavenderBlush, groupControl19);//苍白的紫罗兰红,淡紫红
        }

        private void groupControl20_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.LawnGreen, groupControl20);//草绿色
        }

        private void groupControl21_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.LemonChiffon, groupControl21);//柠檬绸
        }

        private void groupControl22_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.LightSalmon, groupControl22);//浅肉色
        }

        private void groupControl23_Paint(object sender, PaintEventArgs e)
        {
            //Control_Paint(e, Color.LightSeaGreen, groupControl23);//浅肉色
            //Control_Paint(e, Color.LightSkyBlue, groupControl23);//
            //Control_Paint(e, Color.LightGoldenrodYellow, groupControl23);//
            //Control_Paint(e, Color.LightSlateGray, groupControl23);//
            Control_Paint(e, Color.LightSteelBlue, groupControl23);//
        }

        private void groupControl24_Paint(object sender, PaintEventArgs e)
        {
            //Control_Paint(e, Color.Lime, groupControl24);//酸橙；绿黄色
            //Control_Paint(e, Color.LimeGreen, groupControl24);//暗绿;橙绿色
            //Control_Paint(e, Color.Magenta, groupControl24);//品红；洋红
            Control_Paint(e, Color.MintCream, groupControl24);//薄荷色
        }


        private void groupControl25_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.MistyRose, groupControl24);//浅玫瑰色

            //Graphics g = e.Graphics;
            //Color FColor = Color.Transparent;
            //Color TColor = Color.CadetBlue;
            //Brush b = new LinearGradientBrush(groupControl25.ClientRectangle, FColor, TColor, LinearGradientMode.ForwardDiagonal);
            ////Brush b = new LinearGradientBrush(new Rectangle(0, 0, this.Width, this.Height), FColor, TColor, LinearGradientMode.ForwardDiagonal);
            //g.FillRectangle(b, this.ClientRectangle);
        }

        private void groupControl26_Paint(object sender, PaintEventArgs e)
        {
            Control_Paint(e, Color.Moccasin, groupControl24);//鹿皮色
            //Control_Paint(e, Color.NavajoWhite, groupControl24);//印地安黄;纳瓦白
            //Control_Paint(e, Color.Navy, groupControl24);//深蓝色;藏青色
            //Control_Paint(e, Color.Orchid, groupControl24);//兰花紫
            //Graphics g = e.Graphics;
            //Color FColor = Color.AliceBlue;
            //Color TColor = Color.BlueViolet;
            //Brush b = new LinearGradientBrush(groupControl26.ClientRectangle, FColor, TColor, LinearGradientMode.Horizontal);
            ////Brush b = new LinearGradientBrush(new Rectangle(0, 0, this.Width, this.Height), FColor, TColor, LinearGradientMode.ForwardDiagonal);
            //g.FillRectangle(b, this.ClientRectangle);
        }

        #endregion
    }
}